package com.example.doctor.jpa;

import com.example.common.entity.Keys;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface KeysRepository extends JpaRepository<Keys,Long> {

    @Query(value = "SELECT name_nvarchar AS `name` FROM sys_keys WHERE types_tinyint =:types ORDER BY sort_int",nativeQuery = true)
    List<String> findByTypes(@Param("types") Integer types);
}
